﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Himall.Entity.Config
{
   public class RegionAreaInfoConfig : EntityTypeConfiguration<RegionAreaInfo>
    {
        public RegionAreaInfoConfig()
        {
            ToTable("Himall_RegionAreaInfo");
            HasKey(x => x.Id);
            Property(item => item.Id).HasColumnType("varchar").HasMaxLength(50);
            Property(item => item.ParentId).HasColumnType("varchar").HasMaxLength(50);
            Property(item => item.ShortName).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.Name).HasColumnType("varchar").HasMaxLength(100);
            HasRequired(x => x.RegionArea).WithMany(x => x.Sub).HasForeignKey(x => x.ParentId);
        }
    }
}
